package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;

/**
 * 学生实体类
 */
@TableName("t_student")
public class StudentBean {
    /**
     * 编号
     */
    @TableId(value = "pk_studentId", type = IdType.AUTO)
    private Integer id;
    /**
     * 姓名
     */
    @TableField("s_name")
    private String name;
    /**
     * 头像
     */
    @TableField("s_face")
    private String faceImg;
    /**
     * 性别
     */
    @TableField("s_sex")
    private String sex;
    @TableField("fk_classId")
    private Integer classId;
    @TableField("fk_roomId")
    private Integer roomId;
    /**
     * 所属班级
     */
    @TableField(exist = false)
    private ClassBean classObj;
    /**
     * 所住房间
     */
    @TableField(exist = false)
    private RoomBean roomObj;
    /**
     * 电话
     */
    @TableField("s_phone")
    private String phone;
    /**
     * 入住时间
     */
    @TableField("s_enterDate")
    private LocalDate enterDate = LocalDate.now();

    public StudentBean(String name, String faceImg, String sex, ClassBean classObj, RoomBean roomObj, String phone) {
        this.name = name;
        this.faceImg = faceImg;
        this.sex = sex;
        this.classObj = classObj;
        this.roomObj = roomObj;
        this.phone = phone;
    }

    public StudentBean(String name, String faceImg, String sex, Integer classId, Integer roomId, String phone) {
        this.name = name;
        this.faceImg = faceImg;
        this.sex = sex;
        this.classId = classId;
        this.roomId = roomId;
        this.phone = phone;
    }

    public StudentBean() {
    }

    public Integer getClassId() {
        return classId;
    }

    public void setClassId(Integer classId) {
        this.classId = classId;
    }

    public Integer getRoomId() {
        return roomId;
    }

    public void setRoomId(Integer roomId) {
        this.roomId = roomId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFaceImg() {
        return faceImg;
    }

    public void setFaceImg(String faceImg) {
        this.faceImg = faceImg;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public ClassBean getClassObj() {
        return classObj;
    }

    public void setClassObj(ClassBean classObj) {
        this.classObj = classObj;
    }

    public RoomBean getRoomObj() {
        return roomObj;
    }

    public void setRoomObj(RoomBean roomObj) {
        this.roomObj = roomObj;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public LocalDate getEnterDate() {
        return enterDate;
    }

    public void setEnterDate(LocalDate enterDate) {
        this.enterDate = enterDate;
    }

    @Override
    public String toString() {
        return "StudentBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", face='" + faceImg + '\'' +
                ", sex='" + sex + '\'' +
                ", classId=" + classId +
                ", roomId=" + roomId +
                ", classObj=" + classObj +
                ", roomObj=" + roomObj +
                ", phone='" + phone + '\'' +
                ", enterDate=" + enterDate +
                '}';
    }
}
